package l10;

public class test {
    public static void main(String[] args) {
        BinaryTree<Character> tree = new BinaryTree<>();


        System.out.println("树是否为空? " + (tree.isEmpty() ? "是" : "否"));

        tree.preOrderCreate('#');

        System.out.println("树是否为空? " + (tree.isEmpty() ? "是" : "否"));

        // 测试遍历方法
        System.out.print("前序遍历结果: ");
        tree.preOrder();
        System.out.println();

        System.out.print("中序遍历结果: ");
        tree.inOrder();
        System.out.println();

        System.out.print("后序遍历结果: ");
        tree.postOrder();
        System.out.println();

        System.out.print("层序遍历结果: ");
        tree.levelOrderTraverse();
        System.out.println();

        tree.clear();
        System.out.println("执行clear方法后，树是否为空? " + (tree.isEmpty() ? "是" : "否"));
    }
}
